home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 37
/
Aminet 37 (2000)(Schatztruhe)[!][Jun 2000].iso
/
Aminet
/
text
/
edit
/
BareED.lha
/
BareED
/
rexx
/
CountWords.rx
< prev
next >
Wrap
Text File
|
2000-02-05
|
645b
|
47 lines
/* Demo - to get amount of words in a file */
BAREED_HOST = GetClip('BAREED')
IF BAREED_HOST = '' THEN DO
CALL SetClip('BAREED') /* Remove from ClipNode */
EXIT 5
END
ADDRESS VALUE BAREED_HOST
CALL SetClip('BAREED') /* Remove from ClipNode */
OPTIONS RESULTS
/* ---------------------- MAIN --------------------- */
count = 0
move cursor archiveend
posy = 1
newy = 0
do while newy < posy
'find previous word'
fault = rc
if fault ~= 0 then do
get cursor y
posy = result
move cursor left
get cursor y
newy = result
end
if fault = 0 then
count = count + 1
end
tell "Counted" count "word- and number strings"